import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const global = new Vuex.Store({
  state: {
    statusH: 0,
    titleH: 0,
    chatcore: {}
  },
  mutations: {
    initSystemInfo: (state) => {
      wx.getSystemInfo({
        success (res) {
          state.statusH = res.statusBarHeight
          state.titleH = 46
        }
      })
    }
  }
})

export default global
